package com.itheima.web.interceptor;


import com.itheima.domain.db.Admin;

public class AdminHolder {
    private static  ThreadLocal<Admin> local = new ThreadLocal<>();

    //获得
    public static Admin get(){
        return local.get();
    }

    //获得id
    public static Long getId(){
        return local.get().getId();
    }

    //赋值数据
    public static  void set(Admin admin){
        local.set(admin);
    }
    //删除数据
    public static  void remove(){
        local.remove();
    }
}
